﻿using System;
using PerceptiveMCAPI.Types;
//
namespace PerceptiveMCAPI
{
   internal static class campaignSchedule_Validator
   {
      // sched_time
      internal static Api_ValidatorMessage time_valid( DateTime sched_time )
      {
         if ( sched_time == DateTime.MinValue || sched_time < DateTime.UtcNow.Add( new TimeSpan( 1000 ) ) )
         {
            return Validator.FormatMsg( EnumValues.MessageLevel.Error, "schedule_time",
               "Schedule Time was not specified, or is not in the future. All times are UTC." );
         }
         return null;
      }
      // sched_time_b
      internal static Api_ValidatorMessage time_b_valid( DateTime sched_time_b )
      {
         if ( sched_time_b == DateTime.MinValue ) return null;             // optional, OK

         if ( sched_time_b < DateTime.UtcNow.Add( new TimeSpan( 1000 ) ) )
         {
            return Validator.FormatMsg( EnumValues.MessageLevel.Error, "schedule_time_b",
             "Schedule Time 'b' is not in the future. All times are UTC." );
         }
         return null;
      }

   }
}
